home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Misc / NXSpice / NXSpice.app / scripts / setplot next >
Text File  |  1991-06-24  |  1KB  |  65 lines

  1. * set the current working plot
  2. .control
  3.  
  4. begin
  5.     unset resp
  6.     if $argc
  7.         set resp = $argv[1]
  8.     else
  9.         if $?plots = 0
  10.             echo Error: there aren\'t any plots currently loaded.
  11.             goto bottom
  12.         else
  13.             if $#plots = 0
  14.                 echo Error: there aren\'t any plots currently loaded.
  15.                 goto bottom
  16.             end
  17.         end
  18.  
  19.         if $?resp = 0
  20.             set oldplot = $curplot
  21.             echo '    Type the name of the desired plot:'
  22.             echo ''
  23.             echo '    new    New plot'
  24.             foreach pl $plots
  25.                 set curplot = $pl
  26.                 strcmp i $pl $oldplot
  27.                 if $i = 0
  28.                     echo "Current $pl    $curplottitle ({$curplotname})"
  29.                 else
  30.                     echo "    $pl    $curplottitle ({$curplotname})"
  31.                 end
  32.             end
  33.             set curplot = $oldplot
  34.             echo -n '? '
  35.             set resp = $<
  36.         end
  37.     end
  38.  
  39.  
  40.     strcmp i $resp ""
  41.     if $i = 0
  42.         goto bottom
  43.     end
  44.  
  45.     strcmp i $resp new
  46.     if $i = 0
  47.         set curplot = new
  48.         goto bottom
  49.     end
  50.  
  51.     foreach pl $plots
  52.         strcmp i $resp $pl
  53.         if $i = 0
  54.             set curplot = $pl
  55.             goto bottom
  56.         end
  57.     end
  58.  
  59.     echo Error: no such plot name $resp
  60.  
  61.     label bottom
  62.  
  63.     unset resp i pl newflag oldplot
  64. end
  65.